const user = {
  state: {
    // token: JSON.parse(localStorage.getItem('token')),
    // name: JSON.parse(localStorage.getItem('name')),
    // roles: JSON.parse(localStorage.getItem('roles'))
    carRow: null
  },

  mutations: {
    SET_CAR_EDIT_ROW: (state, row) => {
      localStorage.setItem('CAR_EDIT_ROW', JSON.stringify(row))
      state.carRow = row
    }
  },

  actions: {
    // 清空
    CLEAR_CAR_EDIT_ROW ({
      commit
    }) {
      return new Promise(resolve => {
        commit('SET_CAR_EDIT_ROW', null)
        resolve()
      })
    }
  }
}

export default user
